﻿<!--
 * # 模块 HTML:
 *  Creating - 新通知
 *
 * # 描述:
 *  提供用户创建和发送通知的功能。
 *
 * Copyright (c), 上海沃恩信息科技有限公司.
 * All rights reserved.
 * Licensed under BSD (https://www.pittypat.work/bsd.html).
-->

<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <title>发送通知 | 通知</title>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <meta name="author" content="上海沃恩信息科技有限公司" />

    <link rel="icon" type="image/png" href="../app.png" />

    <link rel="stylesheet" href="../../../../mdc/material-components-web.min.css" />
    <link rel="stylesheet" href="../../../../css/pittypat.css" />
    <style>
        .pt-main {
            padding-top: 0;
        }

        .mi-button {
            background: none;
            border: none;
            padding: 0;
            margin: 0 0 0 16px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        #submit-button-container {
            margin-top: 16px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        #send {
            width: 100%;
        }

        @media (min-width: 480px) {

            .pt-fields-horiz > .pt-field {
                width: 50%;
            }

            #send {
                width: 240px;
            }
        }

        #select-receivers-dialog .mdc-dialog__header {
            flex-direction: column;
            align-items: stretch;
        }

        #select-receivers-panel {
            display: flex;
            align-items: center;
        }

            #select-receivers-panel > .pt-fields {
                flex: 1 1 auto;
            }

        #select-receivers-button,
        #add-receivers-button,
        #load-more {
            flex: 0 0 auto;
            background: none;
            border: none;
            padding: 0;
            margin: 0 0 0 16px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        button:disabled > i {
            color: rgba(0,0,0,0.38);
            color: var(--mdc-theme-text-disabled-on-background, rgba(0,0,0,0.38));
        }

        #search,
        #load-more {
            background: none;
            border: none;
            padding: 0;
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        #loaded-summary {
            margin: 16px 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        #loaded-rows,
        #total-rows {
            color: rgba(0,0,0,0.54);
        }

            #loaded-rows::after {
                content: ' / ';
            }

        #selected-receivers > label {
            flex: 0 0 auto;
        }

        #selected-receivers > div {
            flex: 1 1 auto;
            width: 100%;
            display: flex;
            justify-content: flex-start;
            align-items: flex-start;
            flex-wrap: wrap;
        }

        .selected-receiver {
            display: flex;
            align-items: center;
            height: 32px;
            border: 1px solid rgba(0,0,0,0.12);
            border-radius: 32px;
            padding: 0 8px;
            margin: 4px 8px 4px 0;
        }

            .selected-receiver > b {
                max-width: 7em;
                height: 20px;
                line-height: 20px;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            .selected-receiver > i {
                margin-left: 8px;
                font-size: 20px;
                color: rgba(0,0,0,0.38);
                cursor: pointer;
            }

                .selected-receiver > i:hover {
                    color: rgba(0,0,0,0.54);
                }

        #attachment {
            display: none;
        }

        #upload-progress {
            flex: 1 1 auto;
            height: 3px;
        }

            #upload-progress > span {
                display: block;
                height: 100%;
                width: 0;
                background-color: #ff3d00;
                background-color: var(--mdc-theme-accent, #ff3d00);
            }
    </style>
</head>
<body class="pt-nav-pinned">
    <!-- 页眉 -->
    <header>
        <section class="pt-page-toolbar">
            <button class="pt-nav-toggle mdc-ripple-surface" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                <i class="material-icons">menu</i>
            </button>
            <h1 class="pt-page-title">发送通知</h1>
            <button class="pt-nc-toggle mdc-ripple-surface" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                <i class="material-icons">chat_bubble_outline</i>
                <b></b>
            </button>
            <button class="pt-page-menu-toggle mdc-ripple-surface" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                <i class="material-icons">more_vert</i>
            </button>
            <div class="pt-page-menu mdc-simple-menu mdc-simple-menu--open-from-top-right" tabindex="-1">
                <div class="mdc-simple-menu__items mdc-list" role="menu" aria-hidden="true">
                    <a class="mdc-list-item pt-page-refresh" role="menuitem" tabindex="0">
                        <i class="material-icons mdc-list-item__start-detail">refresh</i>
                        <span>刷新页面</span>
                    </a>
                    <div class="mdc-list-divider" role="separator"></div>
                    <a class="mdc-list-item" role="menuitem" tabindex="0" href="help/index.html" target="_blank">
                        <i class="material-icons mdc-list-item__start-detail">help_outline</i>
                        <span>查看帮助</span>
                    </a>
                    <div class="mdc-list-divider pt-page-menu-logout-divider" role="separator"></div>
                    <a class="mdc-list-item pt-page-menu-logout" role="menuitem">
                        <i class="material-icons mdc-list-item__start-detail">power_settings_new</i>
                        <span>退出</span>
                    </a>
                </div>
            </div>
        </section>
    </header>

    <!-- 工作区 -->
    <main class="pt-main" role="main">
        <div class="pt-fields">
            <div class="pt-field required" id="selected-receivers">
                <label>
                    <b>接收人</b>
                    <input type="hidden" id="receiver-ids" readonly autocomplete="off" />
                </label>
                <div></div>
                <button id="select-receivers" data-target-dialog="#select-receivers-dialog" class="mi-button mdc-ripple-surface mdc-ripple-surface--primary mdc-theme--primary" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                    <i class="material-icons">more_horiz</i>
                </button>
            </div>
            <div class="pt-field required focused">
                <label>
                    <b>主题</b>
                    <input type="text" id="title" maxlength="50" required autofocus autocomplete="off" />
                </label>
            </div>
            <div class="pt-field required">
                <label>
                    <textarea id="body" rows="8" maxlength="200000" autocomplete="off" placeholder="正文(需要填写)"></textarea>
                </label>
            </div>
            <div class="pt-field">
                <label>
                    <b>摘要</b>
                    <input type="text" id="summary" maxlength="200" autocomplete="off" />
                </label>
            </div>
            <div class="pt-field">
                <label>
                    <b>附件</b>
                    <input type="text" id="attachment" readonly autocomplete="off" />
                    <span id="upload-progress">
                        <span></span>
                    </span>
                </label>
                <input type="file" id="attachment-file" style="display:none" accept=".7z,.ai,.bmp,.cdr,.doc,.docx,.dwg,.dwt,.eps,.gif,.gz,.jpeg,.jpg,.pdf,.png,.ppt,.pptx,.psd,.rar,.rtf,.svg,.svgz,.tif,.tiff,.tmp,.txt,.vsd,.vsdx,.xls,.xlsx,.z,.zip" autocomplete="off" />
                <button id="upload-attachment" class="mi-button mdc-ripple-surface mdc-ripple-surface--primary mdc-theme--primary" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                    <i class="material-icons">file_upload</i>
                </button>
                <button id="delete-attachment" disabled class="mi-button mdc-ripple-surface mdc-ripple-surface--primary mdc-theme--primary" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                    <i class="material-icons">delete_forever</i>
                </button>
            </div>
        </div>
        <div class="pt-fields pt-fields-horiz">
            <div class="pt-field">
                <label>
                    <b>紧急程度</b>
                    <select id="urgency">
                        <option value="1" selected>普通</option>
                        <option value="2">紧急</option>
                        <option value="4">特急</option>
                    </select>
                </label>
            </div>
            <hr />
            <div class="pt-field">
                <label>
                    <b>分组</b>
                    <input type="text" id="group" maxlength="30" autocomplete="off" />
                </label>
            </div>
        </div>
        <div id="submit-button-container">
            <button type="button" id="send" class="mdc-button mdc-button--raised mdc-button--primary">
                发送
            </button>
        </div>
    </main>

    <!-- 对话框 -->
    <div class="pt-menus-dialogs">
        <!-- 用户对话框 -->
        <div class="mdc-dialog" id="select-receivers-dialog">
            <article class="mdc-dialog__surface">
                <header class="mdc-dialog__header">
                    <h2 class="mdc-dialog__header__title" id="select-receivers-dialog-title">添加接收人</h2>
                    <div id="select-receivers-panel">
                        <input type="hidden" id="select-receivers-page-index" value="1" />

                        <div class="pt-fields pt-fields-horiz">
                            <div class="pt-field">
                                <label>
                                    <input type="text" id="select-receivers-name" placeholder="用户名称/登录名称" maxlength="50" autocomplete="off" />
                                </label>
                            </div>
                        </div>

                        <button id="select-receivers-button" class="mdc-ripple-surface mdc-ripple-surface--primary mdc-theme--primary" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                            <i class="material-icons">search</i>
                        </button>
                    </div>
                </header>
                <section class="mdc-dialog__body mdc-dialog__body--scrollable" id="select-receivers-dialog-body">
                    <article class="pt-row">
                        <header>
                            <div class="pt-row-icon">
                                <i class="pt-row-toggle material-icons mdc-ripple-surface mdc-ripple-surface--primary mdc-theme--primary" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                                    check_box_outline_blank
                                </i>
                            </div>
                            <div class="pt-row-info">
                                <div>
                                    <label>名称</label>
                                </div>
                            </div>
                        </header>
                        <section id="receivers"></section>
                    </article>

                    <div id="loaded-summary">
                        <div><span id="loaded-rows">0</span><span id="total-rows">0</span></div>
                        <button id="load-more" class="mdc-ripple-surface mdc-ripple-surface--primary mdc-theme--primary" type="button" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple">
                            <i class="material-icons">more_horiz</i>
                        </button>
                    </div>
                </section>
                <footer class="mdc-dialog__footer">
                    <a class="pt-dialog-footer-help" href="help/index.html#select-receivers" target="_blank">
                        <i class="material-icons">help_outline</i>
                    </a>
                    <div></div>
                    <button type="button" class="mdc-button mdc-dialog__footer__button" data-cancel>关闭</button>
                </footer>
            </article>
            <div class="mdc-dialog__backdrop"></div>
        </div>

        <div class="mdc-snackbar" id="snackbar">
            <div class="mdc-snackbar__text"></div>
            <div class="mdc-snackbar__action-wrapper">
                <button type="button" class="mdc-button mdc-snackbar__action-button"></button>
            </div>
        </div>
    </div>

    <!-- 导航列表 -->
    <nav class="pt-nav">
        <article class="pt-nav-panel">
            <header>
                <div class="pt-nav-toolbar">
                    <a class="mdc-ripple-surface" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple" href="../../../../index.html" title="返回首页">
                        <i class="material-icons">home</i>
                    </a>
                    <a class="pt-nav-refresh mdc-ripple-surface" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple" title="刷新导航">
                        <i class="material-icons">update</i>
                    </a>
                    <a class="pt-nav-pin mdc-ripple-surface" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple" title="取消固定导航">
                        <i class="material-icons">call_received</i>
                    </a>
                </div>
                <div class="pt-nav-userbar">
                    <a href="../../../waln/authority/profile/index.html">
                        <i class="material-icons">account_circle</i>
                        <b>未登录</b>
                    </a>
                </div>
            </header>
            <section></section>
        </article>
        <!-- 导航列表的背景，不要移除该元素 -->
        <div></div>
    </nav>

    <!-- 通知中心 -->
    <aside class="pt-nc">
        <article class="pt-nc-panel">
            <header>
                <a class="pt-nc-close mdc-ripple-surface" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple" data-nc-close>
                    <i class="material-icons">close</i>
                </a>
                <h1>通知中心</h1>
                <a class="mdc-ripple-surface" data-mdc-ripple-is-unbounded data-mdc-auto-init="MDCRipple" href="../../../waln/notifying/inbox/list.html" title="所有已接收">
                    <i class="material-icons">inbox</i>
                </a>
            </header>
            <section></section>
        </article>
        <!-- 通知中心的背景，不要移除该元素 -->
        <div></div>
    </aside>

    <script src="../../../../js/jquery.min.js"></script>
    <script src="../../../../mdc/material-components-web.min.js"></script>
    <script src="../../../../js/pittypat.js"></script>
    <script src="_api.js"></script>
    <script src="send.js"></script>
</body>
</html>